<template>
  <div>
    
    <div class="table margin-top padding-bottom">
      <div class="list" v-for="l in data" :key='l.id'>
		  <h1>{{l.name}}</h1>
		  <p>单价：<input v-model="l.price" type="text" >金币/天 <a @click="che1(l.id,l.price)">修改</a></p>
	  </div>
    </div>
  </div>
</template>

<script>
import { incrementList,updateIncrement } from '@/api/api'
export default {
  data() {
    return {
		data:[]
    }
  },
  created() {
	
	incrementList({type:1}).then(data => {
				  if(data.code == 200){
					  this.data=data.data
				  }
	})
  },
  methods: {
	  che1(id,price){
		  updateIncrement({id:id,price:price}).then(data => {
		  			  if(data.code == 200){
		  				   Is.tip('编辑成功', 2000, 'success')
		  			  }
		  })
		  
	  }
  }}
</script>

<style lang="scss" scoped>
	.list{
		h1{
			font-size: 18px;
			color: #333;
		}
		p{
			font-size: 16px;
			color: #333;
			margin-top: 15px;
			input{
				width: 40px;
				height: 40px;
				font-size: 16px;
				color: #333;
				outline: none;
				text-align: center;
				margin-left: 8px;
				margin-right: 8px;
			}
			a{
				display: inline-block;
				width: 50px;
				height: 40px;
				    color: #333;
					border: 1px solid #ddd;
				    background-color: #fff;
				    border-color: #ddd;
					text-align: center;
					vertical-align: middle;
					line-height: 40px;
					margin-left: 15px;
					border-radius: 10px;
			}
		}
	}
</style>
